<?php

namespace app\ruinuo\service\app;
//自定义页面
use app\common\model\RuinuoApp as DataMode;

//当前模型
use think\facade\Db;

class Custom
{
    /*保存前处理*/
    public function savebefore($params = [], $id = 0)
    {
        if (empty($id)) {
            $num = strtolower($params['a']['num']);
            if ($num == 'admin' || $num == 'api' || $num == 'setting' || $num == 'common' || $num == 'ruinuo') {
                return ['code' => 203, 'msg' => '默认应用不可创建'];
            }
        }
        return $params;
    }

    /*保存后处理*/
    public function saveafter($id = 0)
    {


    }

    /*列表查询前处理*/
    public function listbefore($params = [])
    {
        return $params;
    }

    /*列表查询后处理*/
    public function listafter($params = [])
    {
        return $params;
    }

    /*单条查询后处理*/
    public function oneafter($params = [])
    {
        return $params;
    }

    /*删除前处理*/
    public function delbefore($del_id)
    {
        return $del_id;
    }

    /*删除后处理*/
    public function delafter($del_id)
    {
        return $del_id;
    }

    /*字段编辑前处理*/
    public function tablebefore($params = [])
    {
        return $params;
    }

    /*字段编辑后处理*/
    public function tableafter($params = [])
    {
        return $params;
    }

}